﻿using NHibernate;
using NHibernateFactory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace UnitTest
{
    public class NHibernateFacts
    {
        private static ISession Session
        {
            get
            {
                return NHibernateHelper.OpenSession();
            }
        }

        [Fact]
        public bool SuccessConnection()
        {
            // arrage
            var session = NHibernateHelper.OpenSession();

            //act


            //assert
            Assert.True(session.IsConnected, "Session is connected");

            return session.IsConnected;
        }

        [Fact]
        public static ISession GetSesstion()
        {
            Assert.NotNull(Session);

            return Session;
        }
    }
}
